home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime text / qttext / qttext.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  2.9 KB  |  106 lines

  1. //////////
  2. //
  3. //    File:        QTText.c
  4. //
  5. //    Contains:    QuickTime text media handler sample code.
  6. //
  7. //    Written by:    Tim Monroe
  8. //                parts based on QTTextSample code by Nick Thompson (see develop, issue 20).
  9. //
  10. //    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  11. //
  12. //    Change History (most recent first):
  13. //
  14. //       <1>         11/14/97    rtm        first file; conversion to personal coding style
  15. //       
  16. //////////
  17.  
  18. //////////
  19. //
  20. // header files
  21. //
  22. //////////
  23.  
  24. #ifndef __FIXMATH__
  25. #include <FixMath.h>
  26. #endif
  27.  
  28. #ifndef __MOVIES__
  29. #include <Movies.h>
  30. #endif
  31.  
  32. #ifndef __SCRIPT__
  33. #include <Script.h>
  34. #endif
  35.  
  36. #ifndef __STANDARDFILE__
  37. #include <StandardFile.h>
  38. #endif
  39.  
  40. #include "ComApplication.h"
  41.  
  42. #if TARGET_OS_MAC
  43. #include "MacFramework.h"
  44. #endif
  45.  
  46. #if TARGET_OS_WIN32
  47. #include "WinFramework.h"
  48. #endif
  49.  
  50.  
  51. //////////
  52. //
  53. // compiler flags
  54. //
  55. //////////
  56.  
  57. #define USE_MOVIESEARCHTEXT        1        // do we use MovieSearchText or TextMediaFindNextText to find text?
  58.  
  59.  
  60. //////////
  61. //
  62. // constants
  63. //
  64. //////////
  65.  
  66. #define kAllTextTracks            0        // special index value to be passed to QTText_RemoveIndTextTrack
  67. #define kTextTrackHeight        20        // default height (in pixels) of the new text track
  68.  
  69. #define kSearchText                "QuickTime"
  70. #define kSampleText                ""
  71.  
  72. #define kBogusStartingTime        -1            // an invalid starting time
  73.  
  74.  
  75. //////////
  76. //
  77. // function prototypes
  78. //
  79. //////////
  80.  
  81. ApplicationDataHdl            QTText_InitWindowData (WindowObject theWindowObject);
  82. void                        QTText_DumpWindowData (WindowObject theWindowObject);
  83. void                        QTText_SetSearchText (void);
  84. void                        QTText_FindText (WindowObject theWindowObject, Str255 theText);
  85. void                        QTText_EditText (WindowObject theWindowObject);
  86. PASCAL_RTN OSErr            QTText_TextProc (Handle theText, Movie theMovie, short *theDisplayFlag, long theRefCon);
  87. Track                        QTText_AddTextTrack (Movie theMovie, char *theStrings[], short theFrames[], short theNumFrames, OSType theType, Boolean isChapterTrack);
  88. OSErr                        QTText_RemoveIndTextTrack (Movie theMovie, short theIndex);
  89.  
  90. OSErr                        QTText_SetTextTrackAsChapterTrack (WindowObject theWindowObject, OSType theType, Boolean isChapterTrack);
  91. Boolean                        QTText_TrackTypeHasAChapterTrack (Movie theMovie, OSType theType);
  92. Boolean                        QTText_TrackHasAChapterTrack (Track theTrack);
  93. Boolean                        QTText_MovieHasAChapterTrack (Movie theMovie);
  94. Track                        QTText_GetChapterTrackForTrack (Track theTrack);
  95. Track                        QTText_GetChapterTrackForMovie (Movie theMovie);
  96. Boolean                        QTText_IsChapterTrack (Track theTrack);
  97. OSErr                        QTText_GetFirstChapterTime (Track theChapterTrack, TimeValue *theTime);
  98. OSErr                        QTText_GetNextChapterTime (Track theChapterTrack, TimeValue *theTime);
  99. TimeValue                    QTText_GetIndChapterTime (Track theChapterTrack, long theIndex);
  100. char *                        QTText_GetIndChapterText (Track theChapterTrack, long theIndex);
  101. long                        QTText_GetChapterCount (Track theChapterTrack);
  102.  
  103.  
  104. void                        QTText_CopyCStringToPascal (const char *theSrc, Str255 theDst);
  105. void                        QTText_UpdateMovieAndController (MovieController theMC);
  106.